package 笔试2.b站2.two;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/*
ABCDEFG
CBA
 */
public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String A = sc.nextLine();
        String B = sc.nextLine();
        //
        Set<Character> set = new HashSet<>();
        for(int i = 0; i< B.length(); i++){
            set.add(B.charAt(i));
        }
//        System.out.println(set);

        StringBuilder sb = new StringBuilder();
        int k=0;
        for(int i=0;i<A.length();i++){
            if(set.contains(A.charAt(i))){
                sb.append(B.charAt(k));k++;
            }
            else{
                sb.append(A.charAt(i));
            }
        }
        System.out.println(sb.toString());
    }

}
